<?php
/**
 * Created by 张彪.
 * User: 小马出行
 * Date: 2018/4/18
 * Time: 11:34
 */
namespace app\admin\inter_model;
use app\inter\model\InterBase;
use think\Db;

class DriverLoginLogModel extends InterBase
{
    public function getLoginLog($map,$field='lld.*',$flag = true,$page=1,$limit=10,$config='')
    {
        $config = $config?:$this->config;
        return  $flag ? Db::connect($config)->name('login_log_driver lld')
            ->join(['xm_driver_base' => 'd'],'d.driver_id=lld.driver_id','LEFT')
            ->where($map)->field($field)->page($page,$limit)->order('log_id desc')->select()
           : Db::connect($config)->name('login_log_driver lld')
                ->join(['xm_driver_base' => 'd'],'d.driver_id=lld.driver_id','LEFT')
                ->where($map)->field($field)->find();
    }

}